#ifndef C_SENDER_DIALOG_H
#define C_SENDER_DIALOG_H

#pragma once
#include "afxwin.h"
#include "afxcmn.h"
#include "PopupMessageInfo.h"
#include "PopupClientInfo.h"
#include "resource.h"

class CpopupApp;

// CSenderDialog dialog

class CSenderDialog : public CDialog
{
	DECLARE_DYNAMIC(CSenderDialog)

public:
	CSenderDialog(CWnd* pParent = NULL);   // standard constructor
	virtual ~CSenderDialog();

    // Dialog Data
	enum { IDD = IDD_DIALOG_SENDEVENT };

	virtual BOOL validateDialog();
	void clearClients();
	void updateClientStatus(const PopupClientInfo & p_client);
	bool SetFromMessageInfo(const PopupMessageInfo & p_message, bool _replyAll);

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL OnInitDialog( );
	virtual void OnOK( );
	bool validateData(CString & errMsg, PopupMessageInfo & p_msg);
	CpopupApp *m_app;

	// Event attributes
	CString m_popupResourceName;
	CString m_popupTarget;
	CString m_popupImageFile;
	CString m_popupSoundFile;
	CString m_popupVideoFile;
	bool    m_modal;
	bool    m_raw;

	CImageList m_imageList;
	CButton    m_chkModal;
	CComboBox  m_cbImageFile;
	CComboBox  m_cbSoundFile;
	CComboBox  m_cbVideoFile;
	CListCtrl  m_lcTargetName;
	CListCtrl  m_lcPopupResourceName;
	BOOL       m_chkKill;

	DECLARE_MESSAGE_MAP()

public:
	afx_msg void OnBnClickedCheckModal();
	afx_msg void OnBnClickedButtonBrowseImage();
	afx_msg void OnBnClickedButtonBrowseSound();
	afx_msg void OnBnClickedButtonBrowseVideo();
	afx_msg void OnLvnGetdispinfoListTarget(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLvnItemchangedListResource(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLvnGetdispinfoListResource(NMHDR *pNMHDR, LRESULT *pResult);

	CString m_message;
	CEdit m_editMessage;

	friend class CMyTabCtrl;

public:
	BOOL m_rawData;
	CButton m_chkRaw;
	afx_msg void OnBnClickedCheckRawData();
	afx_msg void OnBnClickedButtonClear();
};

#endif